package com.zmn.oms.admin.converter;

import com.zmn.oms.common.constant.CodeEnum;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;

/**
 * 常量枚举转换器工厂类
 *
 * @author hankangshuai
 * @date 2019-10-25
 */
public class CodeEnumConverterFactory implements ConverterFactory<String, CodeEnum> {
    @Override
    public <T extends CodeEnum> Converter<String, T> getConverter(Class<T> targetType) {
        //noinspection unchecked,rawtypes
        return new CodeEnumConverter(targetType);
    }
}
